package proxy;

import java.lang.reflect.Proxy;

public class Test {

    public static void main(String[] args) {
        PersonBeanIMpl beanIMpl = new PersonBeanIMpl();
        PersonBean personBeanProxy = (PersonBean) Proxy.newProxyInstance(beanIMpl.getClass().getClassLoader(), beanIMpl.getClass().getInterfaces(), new PersonBeanInvocationHandler(beanIMpl));

        System.out.println(personBeanProxy.getAge());
        System.out.println(personBeanProxy.getName());

    }
}
